package isssr.boundary.src;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;

import isssr.control.src.RoleControl;
import isssr.entity.src.RoleDTO;

import org.primefaces.model.LazyDataModel;
import org.primefaces.model.SortOrder;


@ManagedBean  
@RequestScoped

public class RoleBoundary extends LazyDataModel<RoleDTO> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	//@ManagedProperty(value="#{roleBoundary}")
	private RoleControl roleControl;
	private RoleDTO roleDTO;
	private String title;
	private String description;
	private Integer level;
	
	
	public RoleBoundary() {
		this.roleControl=new RoleControl();
		this.roleDTO=roleControl.getRole().getDTO();
	}


	public RoleDTO getRoleDTO() {
		return roleDTO;
	}


	public void setRoleDTO(RoleDTO roleDTO) {
		this.roleDTO = roleDTO;
	}


	public RoleControl getRoleControl() {
		return roleControl;
	}


	public void setRoleControl(RoleControl roleControl) {
		this.roleControl = roleControl;
	}

	


	public String getTitle() {
		return this.roleDTO.getTitle();
	}


	public void setTitle(String title) {
		this.roleDTO.setTitle(title);
	}


	public String getDescription() {
		return this.roleDTO.getDescription();
	}


	public void setDescription(String description) {
		this.roleDTO.setDescription(description);
	}


	public Integer getLevel() {
		return this.roleDTO.getLevel();
	}


	public void setLevel(Integer level) {
		this.roleDTO.setLevel(level);
	}
	
	public void insert(){
		this.roleControl.insert(roleDTO);
	}
	
	public void delete(){
		this.roleControl.delete(roleDTO);
	}


	@Override
	public List<RoleDTO> load(int arg0, int arg1, String arg2, SortOrder arg3,
			Map<String, String> arg4) {
		// TODO Auto-generated method stub
		return null;
	}
	
	

}
